# SPDX-License-Identifier: BSD-3-Clause
# Copyright (c) 2021-2025, The OpenROAD Authors

add_library(db
    dbBTerm.cpp 
    dbStream.cpp 
    dbBTermItr.cpp 
    dbBPinItr.cpp 
    dbBlock.cpp 
    dbBlockItr.cpp 
    dbBox.cpp 
    dbBoxItr.cpp 
    dbChip.cpp 
    dbDatabase.cpp 
    dbITerm.cpp 
    dbITermItr.cpp 
    dbInst.cpp 
    dbInstHdr.cpp 
    dbLib.cpp 
    dbMPin.cpp 
    dbMPinItr.cpp 
    dbMTerm.cpp 
    dbMaster.cpp 
    dbNet.cpp 
    dbTech.cpp  
    dbTechLayerSpacingRule.cpp 
    dbTechLayerAntennaRule.cpp 
    dbTechMinCutOrAreaRule.cpp 
    dbTechLayerItr.cpp 
    dbTechVia.cpp 
    dbTypes.cpp 
    dbVia.cpp 
    dbWire.cpp 
    dbWireCodec.cpp 
    dbTrackGrid.cpp 
    dbBlockage.cpp 
    dbObstruction.cpp 
    dbObject.cpp 
    dbInstShapeItr.cpp 
    dbTransform.cpp 
    dbITermShapeItr.cpp 
    dbPolygonItr.cpp
    dbSWire.cpp 
    dbSBox.cpp 
    dbSWireItr.cpp 
    dbSBoxItr.cpp 
    dbSite.cpp 
    dbCCSeg.cpp 
    dbCCSegItr.cpp 
    dbWireShapeItr.cpp 
    dbWirePathItr.cpp 
    dbTechNonDefaultRule.cpp 
    dbTechLayerRule.cpp 
    dbCapNode.cpp 
    dbCapNodeItr.cpp 
    dbRSeg.cpp 
    dbRSegItr.cpp 
    dbTechSameNetRule.cpp 
    dbRow.cpp
    dbFill.cpp
    dbShape.cpp 
    dbWireGraph.cpp 
    dbJournal.cpp 
    dbJournalLog.cpp 
    dbBlockCallBackObj.cpp 
    dbRegion.cpp 
    dbRegionInstItr.cpp 
    dbExtControl.cpp 
    dbNullIterator.cpp 
    dbBPin.cpp 
    dbHierInstShapeItr.cpp 
    dbHier.cpp 
    dbTechViaRule.cpp 
    dbTechViaLayerRule.cpp 
    dbTechViaGenerateRule.cpp 
    dbViaParams.cpp 
    dbNameCache.cpp 
    dbProperty.cpp 
    dbPropertyItr.cpp 
    geom.cpp
    tmg_conn.cpp
    tmg_conn_g.cpp
    tmg_conn_s.cpp
    tmg_conn_w.cpp
    wOrder.cpp
    dbGroupPowerNetItr.cpp
    dbGroupGroundNetItr.cpp
    dbGDSLib.cpp
    # Generator Code Begin cpp
    dbAccessPoint.cpp
    dbBusPort.cpp
    dbCellEdgeSpacing.cpp
    dbDft.cpp
    dbGCellGrid.cpp
    dbGDSARef.cpp
    dbGDSBoundary.cpp
    dbGDSBox.cpp
    dbGDSPath.cpp
    dbGDSSRef.cpp
    dbGDSStructure.cpp
    dbGDSText.cpp
    dbGlobalConnect.cpp
    dbGroup.cpp
    dbGuide.cpp
    dbIsolation.cpp
    dbLevelShifter.cpp
    dbLogicPort.cpp
    dbMarker.cpp
    dbMarkerCategory.cpp
    dbMasterEdgeType.cpp
    dbMetalWidthViaMap.cpp
    dbModBTerm.cpp
    dbModInst.cpp
    dbModITerm.cpp
    dbModNet.cpp
    dbModule.cpp
    dbNetTrack.cpp
    dbPolygon.cpp
    dbPowerDomain.cpp
    dbPowerSwitch.cpp
    dbScanChain.cpp
    dbScanInst.cpp
    dbScanList.cpp
    dbScanPartition.cpp
    dbScanPin.cpp
    dbTechLayer.cpp
    dbTechLayerAreaRule.cpp
    dbTechLayerArraySpacingRule.cpp
    dbTechLayerCornerSpacingRule.cpp
    dbTechLayerCutClassRule.cpp
    dbTechLayerCutEnclosureRule.cpp
    dbTechLayerCutSpacingRule.cpp
    dbTechLayerCutSpacingTableDefRule.cpp
    dbTechLayerCutSpacingTableOrthRule.cpp
    dbTechLayerEolExtensionRule.cpp
    dbTechLayerEolKeepOutRule.cpp
    dbTechLayerForbiddenSpacingRule.cpp
    dbTechLayerKeepOutZoneRule.cpp
    dbTechLayerMaxSpacingRule.cpp
    dbTechLayerMinCutRule.cpp
    dbTechLayerMinStepRule.cpp
    dbTechLayerSpacingEolRule.cpp
    dbTechLayerSpacingTablePrlRule.cpp
    dbTechLayerTwoWiresForbiddenSpcRule.cpp
    dbTechLayerWidthTableRule.cpp
    dbTechLayerWrongDirSpacingRule.cpp
    dbGroupInstItr.cpp
    dbGroupItr.cpp
    dbGroupModInstItr.cpp
    dbGuideItr.cpp
    dbModuleBusPortModBTermItr.cpp
    dbModuleInstItr.cpp
    dbModuleModBTermItr.cpp
    dbModuleModInstItr.cpp
    dbModuleModInstModITermItr.cpp
    dbModuleModNetBTermItr.cpp
    dbModuleModNetITermItr.cpp
    dbModuleModNetItr.cpp
    dbModuleModNetModBTermItr.cpp
    dbModuleModNetModITermItr.cpp
    dbModulePortItr.cpp
    dbNetTrackItr.cpp
    dbRegionGroupItr.cpp
    # Generator Code End cpp
)

target_include_directories(db
    PUBLIC
        ${PROJECT_SOURCE_DIR}/include
        ${TCL_INCLUDE_PATH}
    PRIVATE
        ${Boost_INCLUDE_DIRS}
)

set_target_properties(db
  PROPERTIES
    # python requirement
    POSITION_INDEPENDENT_CODE ON
)

target_link_libraries(db
    PUBLIC
        zutil
        utl_lib
        ${TCL_LIBRARY}

)
